// npm install gm-crypt
function SM4 (config, text) {
  const sm4 = require("gm-crypt").sm4;
  i = new sm4(config).encrypt(text);
  return i
}

config = {
  "key": "a85ec9f77459825e",
  "mode": "ecb",
  "cipherType": "base64"
}



console.log(SM4(config, '1234567'))